home *** CD-ROM | disk | FTP | other *** search
/ Risc World 3 / Risc World 3.iso / SOFTWARE / ISSUE2 / PD / VINCE / !ViNCe / h / vncviewer < prev   
Text File  |  2002-07-04  |  3KB  |  114 lines

  1. /*
  2.  *  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.
  3.  *
  4.  *  This is free software; you can redistribute it and/or modify
  5.  *  it under the terms of the GNU General Public License as published by
  6.  *  the Free Software Foundation; either version 2 of the License, or
  7.  *  (at your option) any later version.
  8.  *
  9.  *  This software is distributed in the hope that it will be useful,
  10.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.  *  GNU General Public License for more details.
  13.  *
  14.  *  You should have received a copy of the GNU General Public License
  15.  *  along with this software; if not, write to the Free Software
  16.  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
  17.  *  USA.
  18.  */
  19.  
  20. /*
  21.  * vncviewer.h
  22.  */
  23.  
  24. #include <stdio.h>
  25. #include <stdlib.h>
  26. #include <string.h>
  27. #include "rfbproto.h"
  28.  
  29. extern int supporttight;
  30. extern int bpp;
  31. extern int debug;
  32. extern int displaycursor;
  33. extern int checkclientbitmap;
  34. extern int dither8;
  35. extern int addrectshift;
  36. extern unsigned short rgb332_rgb555_table[256];
  37.  
  38. //#define Swap16IfLE(s)
  39. //    (*(char *)&endianTest ? ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)) : (s))
  40. //
  41. //#define Swap32IfLE(l)
  42. //    (*(char *)&endianTest ? ((((l) & 0xff000000) >> 24) |
  43. //                 (((l) & 0x00ff0000) >> 8)  |
  44. //                 (((l) & 0x0000ff00) << 8)  |
  45. //                 (((l) & 0x000000ff) << 24))  : (l))
  46. #define Swap16IfLE(s)  ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff))
  47. #define Swap32IfLE(l)  ((((l) & 0xff000000) >> 24) |         \
  48.                 (((l) & 0x00ff0000) >> 8)  |         \
  49.                 (((l) & 0x0000ff00) << 8)  |         \
  50.                 (((l) & 0x000000ff) << 24))
  51.  
  52. #define MAX_ENCODINGS 10
  53.  
  54. #define FLASH_PORT_OFFSET 5400
  55. #define LISTEN_PORT_OFFSET 5500
  56. #define SERVER_PORT_OFFSET 5900
  57.  
  58.  
  59. extern char vncServerHost[];
  60. extern int vncServerPort;
  61.  
  62. extern int numCmdLineOptions;
  63.  
  64. /* rfbproto.c */
  65.  
  66. extern int rfbsock;
  67. extern Bool canUseCoRRE;
  68. extern Bool canUseHextile;
  69. extern char *desktopName;
  70. extern rfbPixelFormat myFormat;
  71. extern rfbServerInitMsg si;
  72. extern char *serverCutText;
  73. extern Bool newServerCutText;
  74.  
  75. extern char password[9];
  76.  
  77. extern Bool ConnectToRFBServer(unsigned int hostname, int port);
  78. extern Bool InitialiseRFBConnection(void);
  79. extern Bool SetFormatAndEncodings(void);
  80. extern Bool SendIncrementalFramebufferUpdateRequest(void);
  81. extern Bool SendFramebufferUpdateRequest(int x, int y, int w, int h,
  82.                      Bool incremental);
  83. extern Bool SendPointerEvent(int x, int y, int buttonMask);
  84. extern Bool SendKeyEvent(CARD32 key, Bool down);
  85. extern Bool SendClientCutText(char *str, int len);
  86. extern Bool HandleRFBServerMessage(void);
  87. extern void CloseConnection(void);
  88.  
  89. extern void PrintPixelFormat(rfbPixelFormat *format);
  90.  
  91. /* sockets.c */
  92.  
  93. extern Bool errorMessageOnReadFailure;
  94.  
  95. extern Bool ReadFromRFBServer(char *out, unsigned int n);
  96. extern Bool WriteExact(int sock, void *buf, int n);
  97. extern int ConnectToTcpAddr(unsigned int host, int port);
  98. extern Bool SetNonBlocking(int sock);
  99. extern void CloseSocket(int sock);
  100.  
  101. extern int totalread;
  102.  
  103. /* vncviewer.c */
  104. void UpdateWindow(int x, int y, int w, int h);
  105. int fast_copy_ok(void);
  106. void BlockCopy(int rx, int ry, int rw, int rh, int sx, int sy);
  107.  
  108. /* cursor.c */
  109.  
  110. extern Bool HandleXCursor(int xhot, int yhot, int width, int height);
  111.  
  112.  
  113. void poll(void);
  114.